package site.sorghum.ddl.extra;

public class ColumnNameUtil {
    public static String removePrefixSuffixChar(String str) {
        if (str == null || str.isEmpty()) {
            return str;
        }

        // Define the pattern for characters to keep (alphanumeric and underscore)
        String regex = "^[^a-zA-Z0-9_]+|[^a-zA-Z0-9_]+$";

        // Remove matching characters from start and end
        return str.replaceAll(regex, "");
    }
}
